import request from '@/hooks/request'

const Api = {
  getSimpleQuotationList: '/platform/simpleQuotation/getSimpleQuotationList', // 获取预报价列表
  addSimpleQuotation: '/platform/simpleQuotation/addSimpleQuotation', // 新增预报价
  editSimpleQuotation: '/platform/simpleQuotation/editSimpleQuotation', // 修改预报价
  simpleQuotationPushRobots: '/platform/simpleQuotation/simpleQuotationPushRobots', // 推送预报价
  deleteSimpleQuotation: '/platform/simpleQuotation/deleteSimpleQuotation', // 删除预报价
  editSimpleQuotationStatus: '/platform/simpleQuotation/editSimpleQuotationStatus', // 修改预报价启用状态
}

export const editSimpleQuotationStatus = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.editSimpleQuotationStatus,
    data: parameter,
  })
}

export const getSimpleQuotationList = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.getSimpleQuotationList,
    data: parameter,
  })
}

export const addSimpleQuotation = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.addSimpleQuotation,
    data: parameter,
  })
}

export const editSimpleQuotation = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.editSimpleQuotation,
    data: parameter,
  })
}

export const simpleQuotationPushRobots = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.simpleQuotationPushRobots,
    data: parameter,
  })
}

export const deleteSimpleQuotation = (parameter: Record<any, any>) => {
  const formData = new FormData()
  formData.append('id', parameter.id)
  return request({
    method: 'post',
    url: Api.deleteSimpleQuotation,
    data: formData,
  })
}
